package cn.jietuo.juc.c_000;

/**
 * @author zhangx & jietuo_zx@163.com
 * @version 1.0
 * @date 2020/5/2
 * @description: 如何创建线程
 */
public class T02_HowToCreate {

    static class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println("hello , MyThread~");
        }
    }

    static class MyRunnable implements Runnable{
        @Override
        public void run() {
            System.out.println("hello , MyRunnable~");
        }
    }

    public static void main(String[] args) {
        new MyThread().start();
        new Thread(new MyRunnable()).start();
        new Thread(()->{
            System.out.println("hello , Thread~");
        }).start();
    }
}
